import { flipObject } from './utils';

/**
 * TLS1 cipher suites sourced from OpenSSL:
 *
 * https://github.com/openssl/openssl/blob/36254fda37fe169e136079404a3c32aeea35cbd4/include/openssl/tls1.h#L371
 */
export const CipherSuites = {
	TLS1_CK_PSK_WITH_RC4_128_SHA: 0x008a,
	TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA: 0x008b,
	TLS1_CK_PSK_WITH_AES_128_CBC_SHA: 0x008c,
	TLS1_CK_PSK_WITH_AES_256_CBC_SHA: 0x008d,
	TLS1_CK_DHE_PSK_WITH_RC4_128_SHA: 0x008e,
	TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA: 0x008f,
	TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA: 0x0090,
	TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA: 0x0091,
	TLS1_CK_RSA_PSK_WITH_RC4_128_SHA: 0x0092,
	TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA: 0x0093,
	TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA: 0x0094,
	TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA: 0x0095,
	TLS1_CK_PSK_WITH_AES_128_GCM_SHA256: 0x00a8,
	TLS1_CK_PSK_WITH_AES_256_GCM_SHA384: 0x00a9,
	TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256: 0x00aa,
	TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384: 0x00ab,
	TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256: 0x00ac,
	TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384: 0x00ad,
	TLS1_CK_PSK_WITH_AES_128_CBC_SHA256: 0x00ae,
	TLS1_CK_PSK_WITH_AES_256_CBC_SHA384: 0x00af,
	TLS1_CK_PSK_WITH_NULL_SHA256: 0x00b0,
	TLS1_CK_PSK_WITH_NULL_SHA384: 0x00b1,
	TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256: 0x00b2,
	TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384: 0x00b3,
	TLS1_CK_DHE_PSK_WITH_NULL_SHA256: 0x00b4,
	TLS1_CK_DHE_PSK_WITH_NULL_SHA384: 0x00b5,
	TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256: 0x00b6,
	TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384: 0x00b7,
	TLS1_CK_RSA_PSK_WITH_NULL_SHA256: 0x00b8,
	TLS1_CK_RSA_PSK_WITH_NULL_SHA384: 0x00b9,
	TLS1_CK_PSK_WITH_NULL_SHA: 0x002c,
	TLS1_CK_DHE_PSK_WITH_NULL_SHA: 0x002d,
	TLS1_CK_RSA_PSK_WITH_NULL_SHA: 0x002e,
	TLS1_CK_RSA_WITH_AES_128_SHA: 0x002f,
	TLS1_CK_DH_DSS_WITH_AES_128_SHA: 0x0030,
	TLS1_CK_DH_RSA_WITH_AES_128_SHA: 0x0031,
	TLS1_CK_DHE_DSS_WITH_AES_128_SHA: 0x0032,
	TLS1_CK_DHE_RSA_WITH_AES_128_SHA: 0x0033,
	TLS1_CK_ADH_WITH_AES_128_SHA: 0x0034,
	TLS1_CK_RSA_WITH_AES_256_SHA: 0x0035,
	TLS1_CK_DH_DSS_WITH_AES_256_SHA: 0x0036,
	TLS1_CK_DH_RSA_WITH_AES_256_SHA: 0x0037,
	TLS1_CK_DHE_DSS_WITH_AES_256_SHA: 0x0038,
	TLS1_CK_DHE_RSA_WITH_AES_256_SHA: 0x0039,
	TLS1_CK_ADH_WITH_AES_256_SHA: 0x003a,
	TLS1_CK_RSA_WITH_NULL_SHA256: 0x003b,
	TLS1_CK_RSA_WITH_AES_128_SHA256: 0x003c,
	TLS1_CK_RSA_WITH_AES_256_SHA256: 0x003d,
	TLS1_CK_DH_DSS_WITH_AES_128_SHA256: 0x003e,
	TLS1_CK_DH_RSA_WITH_AES_128_SHA256: 0x003f,
	TLS1_CK_DHE_DSS_WITH_AES_128_SHA256: 0x0040,
	TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA: 0x0041,
	TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA: 0x0042,
	TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA: 0x0043,
	TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA: 0x0044,
	TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA: 0x0045,
	TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA: 0x0046,
	TLS1_CK_DHE_RSA_WITH_AES_128_SHA256: 0x0067,
	TLS1_CK_DH_DSS_WITH_AES_256_SHA256: 0x0068,
	TLS1_CK_DH_RSA_WITH_AES_256_SHA256: 0x0069,
	TLS1_CK_DHE_DSS_WITH_AES_256_SHA256: 0x006a,
	TLS1_CK_DHE_RSA_WITH_AES_256_SHA256: 0x006b,
	TLS1_CK_ADH_WITH_AES_128_SHA256: 0x006c,
	TLS1_CK_ADH_WITH_AES_256_SHA256: 0x006d,
	TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA: 0x0084,
	TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA: 0x0085,
	TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA: 0x0086,
	TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA: 0x0087,
	TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA: 0x0088,
	TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA: 0x0089,
	TLS1_CK_RSA_WITH_SEED_SHA: 0x0096,
	TLS1_CK_DH_DSS_WITH_SEED_SHA: 0x0097,
	TLS1_CK_DH_RSA_WITH_SEED_SHA: 0x0098,
	TLS1_CK_DHE_DSS_WITH_SEED_SHA: 0x0099,
	TLS1_CK_DHE_RSA_WITH_SEED_SHA: 0x009a,
	TLS1_CK_ADH_WITH_SEED_SHA: 0x009b,
	TLS1_CK_RSA_WITH_AES_128_GCM_SHA256: 0x009c,
	TLS1_CK_RSA_WITH_AES_256_GCM_SHA384: 0x009d,
	TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256: 0x009e,
	TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384: 0x009f,
	TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256: 0x00a0,
	TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384: 0x00a1,
	TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256: 0x00a2,
	TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384: 0x00a3,
	TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256: 0x00a4,
	TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384: 0x00a5,
	TLS1_CK_ADH_WITH_AES_128_GCM_SHA256: 0x00a6,
	TLS1_CK_ADH_WITH_AES_256_GCM_SHA384: 0x00a7,
	TLS1_CK_RSA_WITH_AES_128_CCM: 0xc09c,
	TLS1_CK_RSA_WITH_AES_256_CCM: 0xc09d,
	TLS1_CK_DHE_RSA_WITH_AES_128_CCM: 0xc09e,
	TLS1_CK_DHE_RSA_WITH_AES_256_CCM: 0xc09f,
	TLS1_CK_RSA_WITH_AES_128_CCM_8: 0xc0a0,
	TLS1_CK_RSA_WITH_AES_256_CCM_8: 0xc0a1,
	TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8: 0xc0a2,
	TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8: 0xc0a3,
	TLS1_CK_PSK_WITH_AES_128_CCM: 0xc0a4,
	TLS1_CK_PSK_WITH_AES_256_CCM: 0xc0a5,
	TLS1_CK_DHE_PSK_WITH_AES_128_CCM: 0xc0a6,
	TLS1_CK_DHE_PSK_WITH_AES_256_CCM: 0xc0a7,
	TLS1_CK_PSK_WITH_AES_128_CCM_8: 0xc0a8,
	TLS1_CK_PSK_WITH_AES_256_CCM_8: 0xc0a9,
	TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8: 0xc0aa,
	TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8: 0xc0ab,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM: 0xc0ac,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM: 0xc0ad,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8: 0xc0ae,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8: 0xc0af,
	TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256: 0x00ba,
	TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256: 0x00bb,
	TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256: 0x00bc,
	TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256: 0x00bd,
	TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: 0x00be,
	TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256: 0x00bf,
	TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256: 0x00c0,
	TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256: 0x00c1,
	TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256: 0x00c2,
	TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256: 0x00c3,
	TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256: 0x00c4,
	TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256: 0x00c5,
	TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA: 0xc001,
	TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA: 0xc002,
	TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA: 0xc003,
	TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA: 0xc004,
	TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA: 0xc005,
	TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA: 0xc006,
	TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA: 0xc007,
	TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA: 0xc008,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: 0xc009,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: 0xc00a,
	TLS1_CK_ECDH_RSA_WITH_NULL_SHA: 0xc00b,
	TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA: 0xc00c,
	TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA: 0xc00d,
	TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA: 0xc00e,
	TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA: 0xc00f,
	TLS1_CK_ECDHE_RSA_WITH_NULL_SHA: 0xc010,
	TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA: 0xc011,
	TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA: 0xc012,
	TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA: 0xc013,
	TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA: 0xc014,
	TLS1_CK_ECDH_anon_WITH_NULL_SHA: 0xc015,
	TLS1_CK_ECDH_anon_WITH_RC4_128_SHA: 0xc016,
	TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA: 0xc017,
	TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA: 0xc018,
	TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA: 0xc019,
	TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA: 0xc01a,
	TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA: 0xc01b,
	TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA: 0xc01c,
	TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA: 0xc01d,
	TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA: 0xc01e,
	TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA: 0xc01f,
	TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA: 0xc020,
	TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA: 0xc021,
	TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA: 0xc022,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256: 0xc023,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384: 0xc024,
	TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256: 0xc025,
	TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384: 0xc026,
	TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256: 0xc027,
	TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384: 0xc028,
	TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256: 0xc029,
	TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384: 0xc02a,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: 0xc02b,
	TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: 0xc02c,
	TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: 0xc02d,
	TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: 0xc02e,
	TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256: 0xc02f,
	TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384: 0xc030,
	TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256: 0xc031,
	TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384: 0xc032,
	TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA: 0xc033,
	TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA: 0xc034,
	TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA: 0xc035,
	TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA: 0xc036,
	TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256: 0xc037,
	TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384: 0xc038,
	TLS1_CK_ECDHE_PSK_WITH_NULL_SHA: 0xc039,
	TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256: 0xc03a,
	TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384: 0xc03b,
	TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: 0xc072,
	TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: 0xc073,
	TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: 0xc074,
	TLS1_CK_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: 0xc075,
	TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: 0xc076,
	TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384: 0xc077,
	TLS1_CK_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256: 0xc078,
	TLS1_CK_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384: 0xc079,
	TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256: 0xc094,
	TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384: 0xc095,
	TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: 0xc096,
	TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: 0xc097,
	TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256: 0xc098,
	TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384: 0xc099,
	TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: 0xc09a,
	TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: 0xc09b,
	TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305: 0xcca8,
	TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: 0xcca9,
	TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305: 0xccaa,
	TLS1_CK_PSK_WITH_CHACHA20_POLY1305: 0xccab,
	TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305: 0xccac,
	TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305: 0xccad,
	TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305: 0xccae,
} as const;

export const CipherSuitesNames = flipObject(CipherSuites);
